package com.itheima.d2_innerclass;

/**
 * 成员内部类的用法  访问外部类对象 用 Outer.this
 *                创建内部类对象： Outer.inner 对象名  =  new Outer.new inner();
 */
public class Test {
    public static void main(String[] args) {
        People.Heart heart = new People().new Heart();
        People.Heart a1 = new People().new Heart();
        System.out.println(a1.name);
        heart.beat();
    }
}

class People{
    String name = "陈平安";
    static int age = 20;
    private int heartBeat = 80;
    //成员内部类
    class Heart{
        String name = "张山峰";
        int age = 30;
        private int heartBeat = 90;
        public void beat(){
            int heartBeat = 100;
            System.out.println(heartBeat);
            System.out.println(this.heartBeat);
            System.out.println(People.this.heartBeat);

        }
    }
}
